package com.ahwei.user.util.easyexcel.entity;

import com.ahwei.user.util.easyexcel.converter.LocalDateConverter;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.metadata.BaseRowModel;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDate;

/**
 * <p>
 * 这是一个Java文件！
 * </p>
 *
 * @author ahWei
 * @email：ahwei163@qq.com
 * @since 2022-06-15 18:59:50
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class ExcelEntity extends BaseRowModel {
    /**
     * 用户名
     */
    @ExcelProperty(value = {"用户名"}, index = 0)
    private String username;

    /**
     * 密码
     */
    @ExcelProperty(value = {"密码"}, index = 1)
    private String password;

    /**
     * 手机号
     */
    @ExcelProperty(value = {"手机号"}, index = 2)
    private String telephone;

    /**
     * 头像地址
     */
    @ExcelProperty(value = {"头像"}, index = 3)
    private String photo;

    /**
     * 生日
     */
    @ExcelProperty(value = {"生日"}, index = 4,converter = LocalDateConverter.class)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = LocalDateConverter.DEFAULT_DATE_FORMAT, timezone = "GMT+8")
    @DateTimeFormat(LocalDateConverter.DEFAULT_DATE_FORMAT)
    private LocalDate birthday;
}
